using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Shapes;

namespace wicpowerTcpTool.Controls
{
    /// <summary>
    /// 状态指示灯控件
    /// </summary>
    public class StatusLight : UserControl
    {
        private readonly Ellipse light;
        private SolidColorBrush lightBrush;

        public StatusLight()
        {
            light = new Ellipse
            {
                Width = 12,
                Height = 12,
                Stroke = Brushes.DarkGray,
                StrokeThickness = 1
            };

            lightBrush = new SolidColorBrush(Colors.Gray);
            light.Fill = lightBrush;

            Content = light;
        }

        /// <summary>
        /// 指示灯颜色
        /// </summary>
        public Color LightColor
        {
            get => ((SolidColorBrush)light.Fill).Color;
            set
            {
                lightBrush.Color = value;
                light.Fill = lightBrush;
            }
        }
    }
} 